import { get, post } from "../base/request";

// 我的学社
export const getMySociety = () => get("/api/index/my_club");

// 学社首页-切换学社
export const getSocietySwitchList = (club_id) => get("/api/club/switch_list", { club_id });

// 搜索学社
export const getSocietySearch = (data) => get('/api/club/search', data, {}, { loadingText: '正在加载' });

// 学社详情
export const getSocietyDetail = (club_id) => get('/api/club/detail', { club_id });

// 首次进入学社欢迎弹窗
export const getSocietyWelcome = (club_id) => get('/api/club/welcome_pop', { club_id });

// 顾问编辑弹窗-不再提醒
export const postSocietyNomoreRemind = (data) => post('/api/club/nomore_remind', data);

// 获取客户经理
export const getCustomerManager = () => get('/api/club/customer_manager');

// 申请加入学社
export const postSocietyApply = (data) => post("/api/club/apply", data);

// 创建学社 
export const postSocietyCreate = (data) => post('/api/club/create', data)

// 重新提交学社
export const postSocietyResubmit = (data) => post('/api/club/resubmit', data)

// 动态相关
// 发布动态
export const postDynamicAdd = (data) => post('/api/dynamic/add', data)

// 获取动态列表
export const getDynamicLists = (club_id, page) => get('/api/dynamic/lists', { club_id, page }, {}, { loadingText: '正在加载' });

// 设置/取消置顶
export const postDynamicSetTop = (data) => post('/api/dynamic/set_top', data)

// 点赞
export const postDynamicGiveLike = (data) => post('/api/dynamic/give_like', data)

// 取消点赞
export const postDynamicCancelLike = (data) => post('/api/dynamic/cancel_like', data)

// 动态详情
export const getDynamicDetail = (dynamic_id) => get('/api/dynamic/detail', { dynamic_id })

// 删除动态
export const postDynamicDel = (data) => post('/api/dynamic/del', data)

// 评论/回复
export const postDynamicCommentAdd = (data) => post('/api/dynamic/comment_add', data)

// 获取评论
export const getDynamicCommentList = (page, dynamic_id) => get('/api/dynamic/comment_list', { page, dynamic_id }, {}, { loadingText: '正在加载' });

// 评论点赞
export const postDynamicCommentGiveLike = (data) => post('/api/dynamic/comment_give_like', data)

// 评论取消点赞
export const postDynamicCommentCancelLike = (data) => post('/api/dynamic/comment_cancel_like', data)

// 成员相关
// 获取待审核成员数量
export const getMemberAuditNum = (club_id) => get('/api/member/get_audit_num', { club_id });

// 已审核成员列表
export const getMemberLists = (club_id, name = '') => get('/api/member/lists', { club_id, name });

// 待审核成员列表
export const getMemberAuditLists = (club_id) => get('/api/member/audit_list', { club_id });

// 成员详情
export const getMemberModalDetail = (member_id, club_id) => get('/api/member/member_detail', { member_id, club_id });

// 修改成员资料
export const postMemberProfile = (data) => post('/api/member/member_profile', data)

// 审核成员
export const postMemberAudit = (data) => post('/api/member/audit', data)

// 设置管理员
export const postMemberSetAdministrator = (data) => post('/api/member/set_administrator', data)

// 取消管理员
export const postMemberCancelAdministrator = (data) => post('/api/member/cancel_administrator', data)

// 移除成员
export const postMemberDel = (data) => post('/api/member/del', data)

// 获取顾问列表（包括社长）
export const getMemberCounselorList = (club_id) => get('/api/member/counselor_list', { club_id });

// 学社-管理
// 管理学社详情
export const getMemberDetail = (club_id) => get('/api/member/detail', { club_id });

// 编辑成员简介
export const postMemberEditIntro = (data) => post('/api/member/edit_intro', data)

// 编辑学社资料
export const postClubProfile = (data) => post('/api/club/profile', data)

// 编辑自动回复
export const postClubProfileAutoResponse = (data) => post('/api/club/profile_auto_response', data)

// 我的年度业绩规划
export const getMemberMyTarget = (club_id) => get('/api/member/my_target', { club_id });

// 我的年度业绩记录
export const getMemberPerformanceRecord = (club_id, page) => get('/api/member/performance_record', { club_id, page }, {}, { loadingText: '正在加载' });

// 学社-答疑
// 发布提问
export const postQuestionAdd = (data) => post('/api/question/add', data)

// 回答
export const postQuestionAnswer = (data) => post('/api/question/answer', data)

// 我的问答
export const getMyQuestion = (club_id, page, type) => get('/api/question/my_question', { club_id, page, type });

// 答疑列表
export const getQuestionLists = (club_id, page, type) => get('/api/question/lists', { club_id, page, type });

// 设置/取消置顶
export const postQuestionSetTop = (data) => post('/api/question/set_top', data)

// 提问详情
export const getQuestionDetail = (question_id) => get('/api/question/detail', { question_id });

// 删除提问
export const postQuestionDel = (data) => post('/api/question/del', data)

// 提问详情回答列表
export const getQuestionAnswerLists = (question_id) => get('/api/question/answer_list', { question_id });

// 点赞回答
export const postAnswerGiveLike = (data) => post('/api/answer/give_like', data)

// 取消回答点赞
export const postAnswerCancelLike = (data) => post('/api/answer/cancel_like', data)

// 回答详情
export const getAnswerDetail = (answer_id) => get('/api/answer/detail', { answer_id });

// 删除回答
export const postAmswerDel = (data) => post('/api/answer/del', data)

// 评论/回复
export const postAnswerCommentAdd = (data) => post('/api/answer/comment_add', data)

// 评论列表
export const getAnswerCommentList = (page, answer_id) => get('/api/answer/comment_list', { page, answer_id }, {}, { loadingText: '正在加载' });

// 点赞评论
export const postAnswerCommentGiveLike = (data) => post('/api/answer/comment_give_like', data)

// 取消点评论赞
export const postAnswerCommentCancelLike = (data) => post('/api/answer/comment_cancel_like', data)

// 学社-私董会
// 服务列表
export const getDirectorsLists = (club_id) => get('/api/directors/lists', { club_id });

// 提交诊断
export const postDirectorsInitiate = (data) => post('/api/directors/initiate', data)

// 诊断详情
export const getDirectorsDetail = (club_id, service_id, number) => get('/api/directors/detail', { club_id, service_id, number });

// 顾问发布建议
export const postDirectorsGiveAdvice = (data) => post('/api/directors/give_advice', data)

// 社长/管理员回复
export const postDirectorsReply = (data) => post('/api/directors/reply', data)

// 结束服务
export const postDirectorsFinish = (data) => post('/api/directors/finish', data)

// 获取学社基础信息（被驳回使用）
export const getRejectInfo = (data) => get('/api/club/reject_info', data)

// 学社-课程
// 已认领课程列表
export const getSocietyClaimList = (club_id, page) => get('/api/club/claim_list', { club_id, page }, {}, { loadingText: '正在加载' });

// 获取可认领课程列表
export const getCurriculumClaimList = (data) => get('/api/curriculum/claim_list', data);

// 认领课程
export const postCurriculumClaim = (data) => post('/api/curriculum/claim', data)

// 学社-学习成长
// 学习成长列表
export const getWorkLists = (club_id, page) => get('/api/work/lists', { club_id, page }, {}, { loadingText: '正在加载' });

// 发布考试
export const postWorkPublishExam = (data) => post('/api/work/publish_exam', data)

// 学习成长-课程列表
export const getSocietyWorkClaimList = (data) => get('/api/club/choose_list', data, {}, { loadingText: '正在加载' });

// 置顶
export const postWorkSetTop = (data) => post('/api/work/set_top', data)

// 发布课程
export const postWorkPublishClass = (data) => post('/api/work/publish_class', data)

// 查看课程完成情况
export const getClassCompletion = (club_id, class_id) => get('/api/curriculum/class_completion', { club_id, class_id });

// 学社-考试
// 获取考试分类
export const getExamCategory = () => get('/api/exam/category');

// 获取试卷
export const getExamLists = (category_id, page) => get('/api/exam/lists', { category_id, page });

// 查看考试完成情况
export const getExaminationCompletion = (club_id, exam_id) => get('/api/exam/examination_completion', { club_id, exam_id });

// 考试详情
export const getExamDetail = (club_id, exam_id, user_id) => get('/api/exam/detail', { club_id, exam_id, user_id });

// 获取考试题目
export const getExamQuestion = (exam_id) => get('/api/exam/exam_question', { exam_id });

// 提交试卷
export const postExamHandIn = (data) => post('/api/exam/hand_in', data)

// 查看错题集
export const getExamViewError = (exam_log_id) => get('/api/exam/view_error', { exam_log_id });

// 邀请/名片
// 学社邀请二维码
export const getSocietyQrcode = (club_id) => get('/api/club/get_qrcode', { club_id });

// 我的名片
export const getSocietyCard = (club_id) => get('/api/club/card', { club_id });

// 受邀请加入学社
export const postSocietyInvite = (data) => post('/api/club/invite', data)

// 获取未读消息数
export const getUnreadNumber = (club_id) => get('/api/club/unread_number', { club_id })

//我的问答-已读
export const postReadMessage = (message_id) => post('/api/question/read_message', { message_id })

// 取消申请加入学社
export const postSocietyCancelApply = (data) => post('/api/club/cancel_apply', data)

//邀请码设置
export const postSetQrcode = (data) => post('/api/club/set_qrcode', data)









